#include "selectwin.h"
#include "ui_selectwin.h"

SelectWin::SelectWin(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::SelectWin)
{
    ui->setupUi(this);
    m_model=new QSqlTableModel();
}

SelectWin::~SelectWin()
{
    delete ui;
}

void SelectWin::on_selectBt_clicked()
{
    bool flag=ui->empRb->isChecked();
    if(flag)
    {
        m_model->setTable("employee");//设置员工表格
    }
    flag=ui->attRb->isChecked();
    if(flag)
    {
        m_model->setTable("attendance");
    }


    //查询
    m_model->select();

    ui->tableView->setModel(m_model);
}

